from collections import deque from sys import stdin n, m = 0, 0 for l in stdin: if n == m == 0: n, m, h = int(l), -1, {} g = {1< 0: n -= 1 h[l.strip()] = 1<